<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" />
		<link href="css/mui.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/comment.css"/>
		<link rel="stylesheet" type="text/css" href="css/center.css"/>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav gradient">
			<div style="height: 20px;"></div>
			<h1 class="mui-title">我的</h1>
			<div class="mui-pull-right warnInfo">
				<span class="mui-badge mui-badge-danger" id="warnday">0</span>
			</div>
			<div class="mTiAll">
				<div class="mLeft">
					<h3>中国石油</h3>
					<span>奉献能源，创造和谐！</span>
				</div>
				<div class="mRight">
					<a>
						<img src="images/logo_03.png" alt="">
					</a>
				</div>
			</div>
		</header>
		
		<div class="mui-content">
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mPerson">
					<a class="mui-navigate-right">
						个人信息
					</a>
				</li>
				<li class="mui-table-view-cell mSet">
					<a class="mui-navigate-right">
						重置密码
					</a>
				</li>
				<li class="mui-table-view-cell mHelp">
					<a class="mui-navigate-right">
						使用帮助
					</a>
				</li>
				<li class="mui-table-view-cell mAbout">
					<a class="mui-navigate-right">
						关于我们
					</a>
				</li>
				<li>
					<div class="mainButton">
						<button type="button" class="password_btn" style="line-height:.5">切换账户</button>
					</div>
				</li>
			</ul>
		</div>
		
		<script src="js/mui.js"></script>
		<script src="js/jquery.js"></script>
		<script src="js/rem.js"></script>
		<script type="text/javascript">
			mui.init();
			mui.plusReady(function () {
				//关闭等待框
				plus.nativeUI.closeWaiting();
				var myself = plus.webview.getWebviewById("center.html");
				myself.addEventListener("show", function() {
					var eqno = localStorage.getItem("eqno")
					$.ajax({
						type:'get',
						url: 'http://112.54.80.235:8038' + '/actionapi/Users/GetBaoJingToDayCount',
						data:{
							devicename:eqno
						},
						dataType: 'json',
						success:function(data){
							var datas = data.data;
							$("#warnday").text(datas)
							
						}
					});
				})
				//初始化加载报警数量
				var eqno = localStorage.getItem("eqno")
				$.ajax({
					type:'get',
					url: 'http://112.54.80.235:8038' + '/actionapi/Users/GetBaoJingToDayCount',
					data:{
						devicename:eqno
					},
					dataType: 'json',
					success:function(data){
						var datas = data.data;
						$("#warnday").text(datas)
						
					}
				});
				
				//报警按钮
				$('.warnInfo').click(function(){
					mui.openWindow({
						url: "alarmMessage.html",
						id: "alarmMessage.html",
						extras: {
							info: 0
						},
						waiting: {
							autoShow: true, //自动显示等待框，默认为true
							title: '正在加载...', //等待对话框上显示的提示内容
						}
					})
				});
				// //编辑个人信息
				// $('.mRight').click(function(){
				// 	mui.openWindow({
				// 		url: "message.html",
				// 		id: "message.html",
				// 		waiting: {
				// 			autoShow: true, //自动显示等待框，默认为true
				// 			title: '正在加载...', //等待对话框上显示的提示内容
				// 		}
				// 	})
				// });
				//个人信息
				$('.mPerson').click(function(){
					mui.openWindow({
						url: "person.html",
						id: "person.html",
						waiting: {
							autoShow: true, //自动显示等待框，默认为true
							title: '正在加载...', //等待对话框上显示的提示内容
						}
					})
				});
				//使用帮助
				$('.mHelp').click(function(){
					mui.openWindow({
						url: "help.html",
						id: "help.html",
						waiting: {
							autoShow: true, //自动显示等待框，默认为true
							title: '正在加载...', //等待对话框上显示的提示内容
						}
					})
				});
				//关于我们
				$('.mAbout').click(function(){
					mui.openWindow({
						url: "about.html",
						id: "about.html",
						waiting: {
							autoShow: true, //自动显示等待框，默认为true
							title: '正在加载...', //等待对话框上显示的提示内容
						}
					})
				});
				//操作日志
				$('.mWork').on("tap",function(){
					mui.openWindow({
						url: "operationLog.html",
						id: "operationLog.html",
						// extras: {
						// 	proid: app.$data.DevNo
						// },
						waiting: {
							autoShow: true, //自动显示等待框，默认为true
							title: '正在加载...', //等待对话框上显示的提示内容
						}
					})
				});
				//切换账户
				$('.password_btn').on("tap",function(){
					localStorage.setItem("login_state",0)
					mui.openWindow({
						url: "login.html",
						id: "login.html",
						waiting: {
							autoShow: true, //自动显示等待框，默认为true
							title: '正在加载...', //等待对话框上显示的提示内容
						}
					});
					var main = plus.webview.getWebviewById('main.html');
					plus.webview.close(main);
				});
				//重置密码
				$('.mSet').on("tap",function(){
					mui.openWindow({
						url: "resetPwd.html",
						id: "resetPwd.html",
						waiting: {
							autoShow: true, //自动显示等待框，默认为true
							title: '正在加载...', //等待对话框上显示的提示内容
						}
					})
				});
			})
		</script>
	</body>

</html>
